Optimal. Leaf size=99 \[ \frac{i a^3 (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac{4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac{4 i a^3 (c-i c \tan (e+f x))^{n+1}}{c f (n+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14088, antiderivative size = 99, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.097, Rules used = {3522, 3487, 43} \[ \frac{i a^3 (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac{4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac{4 i a^3 (c-i c \tan (e+f x))^{n+1}}{c f (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3522
Rule 3487
Rule 43
Rubi steps
\begin{align*} \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx &=\left (a^3 c^3\right ) \int \sec ^6(e+f x) (c-i c \tan (e+f x))^{-3+n} \, dx\\ &=\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int (c-x)^2 (c+x)^{-1+n} \, dx,x,-i c \tan (e+f x)\right )}{c^2 f}\\ &=\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int \left (4 c^2 (c+x)^{-1+n}-4 c (c+x)^n+(c+x)^{1+n}\right ) \, dx,x,-i c \tan (e+f x)\right )}{c^2 f}\\ &=\frac{4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac{4 i a^3 (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac{i a^3 (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)}\\ \end{align*}
Mathematica [A] time = 4.05234, size = 110, normalized size = 1.11 \[ \frac{i a^3 \sec ^2(e+f x) (c \sec (e+f x))^n \left (\left (n^2+3 n+4\right ) \cos (2 (e+f x))+i n (n+3) \sin (2 (e+f x))+2 (n+2)\right ) \exp (n (-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x))))}{f n (n+1) (n+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.385, size = 192, normalized size = 1.9 \begin{align*}{\frac{i{a}^{3}n{{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}}{ \left ( 1+n \right ) f \left ( 2+n \right ) }}+{\frac{5\,i{a}^{3}{{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}}{ \left ( 1+n \right ) f \left ( 2+n \right ) }}+{\frac{8\,i{a}^{3}{{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}}{ \left ( 1+n \right ) \left ( 2+n \right ) fn}}-{\frac{i{a}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{2}{{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}}{f \left ( 2+n \right ) }}-2\,{\frac{{a}^{3} \left ( 3+n \right ) \tan \left ( fx+e \right ){{\rm e}^{n\ln \left ( c-ic\tan \left ( fx+e \right ) \right ) }}}{ \left ( 1+n \right ) f \left ( 2+n \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.87847, size = 737, normalized size = 7.44 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.65345, size = 369, normalized size = 3.73 \begin{align*} \frac{{\left (8 i \, a^{3} +{\left (4 i \, a^{3} n^{2} + 12 i \, a^{3} n + 8 i \, a^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (8 i \, a^{3} n + 16 i \, a^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac{2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{3} + 3 \, f n^{2} + 2 \, f n +{\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \,{\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3}{\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]